<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
$('#tt').tabs({
    border:false,
    onSelect:function(title){
		alert(title+' is selected');
    }
});

function tables(yy){
 	$('#px_anpai').datagrid({    
 		//数据源地址
 		url:'peixunanpaichaxun',
	 	queryParams:{
	 		empname:yy
		},
	    columns:[[
	    	{field:'EMPNAME',fixed:false,width:180,title:'员工姓名',align:'center'},    
	        {field:'IONREM',fixed:false,width:180,title:'个人意向',align:'center'},   
	        {field:'ZKZREM',fixed:false,width:180,title:'准考证',align:'center'},  
	        {field:'FEBMINTIME',fixed:false,width:180,title:'开考时间',align:'center',
	    		formatter : function(value){
	        		var d = new Date(value);
	        		var times=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
	        		return times;
	        	}	
	        },    
	        {field:'FEBMAXTIME',fixed:false,width:180,title:'结束时间',align:'center',
	        	formatter : function(value){
	        		var d = new Date(value);
	        		var times=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
	        		return times;
	        	}	
	        },
	        {field:'FEBSC',fixed:false,width:180,title:'考试时长',align:'center'},
	        {field:'JULDZ',fixed:false,width:180,title:'考试地点',align:'center'},
	        {field:'OUTNAME',fixed:false,width:180,title:'考试试卷',align:'center'}
	    
	    ]],
	    pagination:true,
	    pageNumber:1,
	    pageSize:5,
	    pageList:[5,10,15]
	});
}
function peixunsousuo(value,name){
	tables(value);
}
$(function(){
	//显示
	 $('#Shijuan').combobox({
		 url:'shijuan2',
		 valueField:'OUTID',
		 textField:'OUTNAME'
	 });
 	tables(null);

	//点击安排按钮显示窗口
	$(".px_anpai").click(function(){
		 $("#px_kaoshianpai").window("open"); 
			
		 	$('#px_yixiangbiao').datagrid({    
		 		//数据源地址
		 		url:'pxapxingzeng',
			    columns:[[
			    	{field:'FEBID',fixed:false,width:180,checkbox:true,title:'个人意向编号',align:'center'},
			    	{field:'EMPNAME',fixed:false,width:180,title:'员工姓名',align:'center'},   
			    	{field:'POJSID',fixed:false,width:180,title:'个人意向',align:'center'},    
			        {field:'ZKZREM',fixed:false,width:180,title:'准考证',align:'center'},
			        {field:'FEBMINTIME',fixed:false,width:180,title:'开考时间',align:'center'},
			        {field:'FEBMAXTIME',fixed:false,width:180,title:'结束时间',align:'center'},
			        {field:'JULDZ',fixed:false,width:180,title:'考试地址',align:'center'}
			    ]],
			    pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,10,15]
			});
	}); 
	 $(".px_bao").click(function(){
		var rows=$('#px_yixiangbiao').datagrid('getChecked');
		var outid = $("#Shijuan").val();
		for(var i=0;i<rows.length;i++){
			$.ajax({
				url:"updatekaoshianpai",
				type:"post",
				data:{"febid":rows[i]["FEBID"],"outid":outid},
				success:function(data){
					$("#px_kaoshianpai").window("close");
					$( '#px_anpai').datagrid('reload');
				}
			})
		} 
	});

})
	
 function add(text,url){
	if(url!=undefined){
		$('#tit').tabs('add',{
			id: 'tit1',
			title: text,
			closable: true,
			href: "http://localhost:8080/"+url
		});
	}
} 

$(".px_qu").click(function(){
	$("#px_kaoshianpai").window("close"); 
	
})
	
</script>

			    	   <div id="px_kaoshianpai" class="easyui-window" title="考试安排" style="width:800px;height:550px"
		    		data-options="closed:true,minimizable:false,maximizable:false,collapsible:false,resizable: false,draggable:false,modal:true">
		    		             
		    		             <div class="px_center">
		    		                    <table id="px_yixiangbiao" class="easyui-datagrid" style="width:100%;height:330px;margin-top:10px;" data-options="fitColumns:true">
                                
                                         </table>
		    		             </div>
		    		             <div class="px_bottom">
		    		                   <div class="px_shijuankuang">
		    		                      <div class="px_kaojuan">试卷名称：
		    		                          <input id="Shijuan" class="easyui-combobox shijuanshuru">  
		    		                      </div>
		    		                   </div>
		    		            </div>
		    		               <div class="px_anniu">
		    		                    <div class="px_baocun"><button class="px_bao"><img src="../static/tyl/images/go.png">保存</button></div>
		    		                    <div class="px_quxiao"><button class="px_qu"><img src="../static/tyl/images/cha.png">取消</button></div>
		    		               </div>
		    		       </div>
		    		           
				<div class="peixun_zong">
				
				    <div class="peixun_shang">
				               <div class="px_xianshi">
				                  <button class="px_anpai">考试安排</button>
				               </div>
				              <div class="px_shanchu">
				                 <input id="ss" class="easyui-searchbox" style="width:300px" data-options="searcher:peixunsousuo,prompt:'请输入需要查询的姓名'"></input>
				               </div>
				    </div>
				    <div class="peixun_xia">
				             <table id="px_anpai" class="easyui-datagrid" style="width:100%;height:360px;margin-top:20px;" data-options="fitColumns:true">
                                   
                            </table>
				    </div>
				</div>
			
</body>
</html>